﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ARchGL.Platform.Core;
using ARchGL.Platform.EntityFrameworkCore;

namespace ARchGL.Platform.Mappings
{
    public class ProjectsMapping : IEntityTypeConfiguration<Projects>
    {
        public void Configure(EntityTypeBuilder<Projects> builder)
        {
            //builder.ToTable(MappingConsts.Prefix + nameof(Projects));

            builder.Property(p => p.Name).HasMaxLength(256);
            builder.Property(p => p.Code).HasMaxLength(100);
            builder.Property(p => p.Address).HasMaxLength(100);
            builder.Property(p => p.ImageUrl).HasMaxLength(500);
            builder.Property(p => p.Description).HasMaxLength(500); 
        }
    }

    public class ProjectUsersMapping : IEntityTypeConfiguration<ProjectUsers>
    {
        public void Configure(EntityTypeBuilder<ProjectUsers> builder)
        {
            builder.Property(p => p.Position).HasMaxLength(100);
            builder.Property(p => p.PermissionArray).HasMaxLength(1000);
        }
    }
}
